const Joi = require("joi");

const id = Joi.number().integer().min(1).required();
const number = Joi.string().required();
const galname = Joi.string().min(1).max(20).required();
const nickname = Joi.string().min(1).max(20);
const country = Joi.number().integer().valid(0, 1, 2, 3);
const premiere = Joi.date();
const issue_time = Joi.date();
const address = Joi.string().length(23);
const pwd = Joi.string().length(4);
const intro = Joi.string().min(1).max(500);

//新增数据验证
exports.add_Schema = {
	body: {
		number,
		galname,
		nickname,
		country,
		premiere,
		issue_time,
		address,
		pwd,
		intro
	}
};

// 更新数据
exports.update_Schema = {
	body: {
		number,
		galname,
		nickname,
		country,
		premiere,
		issue_time,
		address,
		pwd,
		intro,
		id
	}
};